<template>
  <div class="cover" @click="handleClick">
    <swiper :options="swiperOption">
      <swiper-slide v-for="(item,index) of gallaryImgs" :key="index">
        <img :src="item.imgUrl" alt>
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
      <div class="swiper-scrollbar" slot="scrollbar"></div>
    </swiper>
  </div>
</template>
<script>
export default {
  name: "DetailGallary",
  props: ["gallaryImgs"],
  data() {
    return {
      swiperOption: {
        pagination: {
          el: ".swiper-pagination",
          type: "fraction"
        },
        observer: true,
        observeParents: true
      }
    };
  },
  methods: {
    handleClick() {
      this.$emit("showGallary");
    }
  }
};
</script>
<style lang="scss" scoped>
.cover {
  background: #333;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  .swiper-container {
    top: 50%;
    transform: translateY(-50%);
    overflow: inherit;
    .swiper-pagination {
      color: #fff;
      bottom: -30px;
    }
    img {
      width: 100%;
      height: 250px;
    }
  }
}
</style>
